import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)  //在vuecli中想要使用插件，首先npm安装，然后再引入插件，最后还要再用Vue.use()install
import Home from './views/Home'
import Shopcart from  './views/Shopcart'
import Member from  './views/Member'
import Search from './views/Search'
import newslist from './views/news/NewsList'
import newsinfo from './views/news/NewsInfo'
import photolist from './views/photo/photoList'
import photoinfo from './views/photo/photoinfo'
import goodslist from './views/goods/goodslist'
import goodsinfo from './views/goods/goodsinfo'
export default new Router({
  routes: [
      {path:'/',redirect:'/home'},
      {path:'/home',component:Home},
      {path:'/shopcart',component:Shopcart},
      {path:'/member',component:Member},
      {path:'/search',component:Search},
      {path:'/home/newslist',component:newslist},
      {path:'/home/newsinfo/:id',component:newsinfo,props:true},
      {path:'/home/photolist',component:photolist},
      {path:'/home/photoinfo/:id',component:photoinfo,props:true},
      {path:'/home/goodslist',component:goodslist},
      {path:'/home/goodsinfo/:id',component:goodsinfo,name:'info'}

  ],
    linkActiveClass:'mui-active'
})
